/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package hudsonlab.view;

import javax.swing.JPanel;

/**
 *
 * @author Daniel Felipe
 */
public class FramePrincipal extends javax.swing.JFrame {

    /**
     * Creates new form FramePrincipal
     */
    public FramePrincipal() {
        initComponents();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jMenuBar1 = new javax.swing.JMenuBar();
        jMenu1 = new javax.swing.JMenu();
        jMenuItem1 = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Cajero PavloV");
        setResizable(false);

        jMenu1.setText("PavloV");
        jMenu1.setEnabled(false);

        jMenuItem1.setText("Cerrar Sesión");
        jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem1ActionPerformed(evt);
            }
        });
        jMenu1.add(jMenuItem1);

        jMenuBar1.add(jMenu1);

        setJMenuBar(jMenuBar1);

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem1ActionPerformed
        // TODO add your handling code here:
        hudsonlab.HudsonLab.getInstance().regresarInicio();
        hudsonlab.HudsonLab.getInstance().setUsuario("");
    }//GEN-LAST:event_jMenuItem1ActionPerformed

    public void agregarPanel(JPanel login) {
    getContentPane().setVisible(false);
    getContentPane().removeAll();
    getContentPane().add(login);
    getContentPane().setVisible(true);
    pack();
    }

    /**
     * @param args the command line arguments
     */
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JMenuItem jMenuItem1;
    // End of variables declaration//GEN-END:variables

    public void habilitarCerrar() {
        jMenu1.setEnabled(true);
    }

    public void deshabilitarCerrar() {
        jMenu1.setEnabled(false);
    }
}
